package com.shop.service;

import com.shop.entity.SalesUser;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface SalesUserService {
    /**
     * 根据id查询
     *
     * @param id
     * @return
     */
    SalesUser findById(int id);

    /**
     * 分页查询所有
     *
     * @param pageable
     * @return
     */
    Page<SalesUser> findAll(Pageable pageable);

    /**
     * 按条件查询
     *
     * @param example
     * @return
     */
    List<SalesUser> findAllExample(Example<SalesUser> example);

    /**
     * 更新
     *
     * @param salesUser
     * @return
     */
    void update(SalesUser salesUser);

    /**
     * 创建
     *
     * @param salesUser
     * @return
     */
    int create(SalesUser salesUser);

    /**
     * 根据Id删除
     *
     * @param id
     * @return
     */
    void delById(int id);

    /**
     * 根据用户名查询
     * @param username
     * @return
     */
    List<SalesUser> findByUsername(String username);

    /**
     * 检查登录
     * @param request
     * @param username
     * @param password
     * @return
     */
    SalesUser checkLogin(HttpServletRequest request,String username, String password);
}
